<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use \common\models\Category;
use \common\models\Painting;

/* @var $this yii\web\View */
/* @var $model common\models\Painting */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="painting-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'category_id')->dropDownList(Category::getCateList(), ['prompt'=>'请选择']) ?>

    <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'describe')->textarea(['rows' => 6]) ?>

    <?= $form->field($model, 'status')->dropDownList(Painting::$statusList) ?>

    <?= $form->field($model, 'show_banner')->dropDownList(Painting::$showStatusList) ?>

    <?= $form->field($model, 'image')->widget('common\widgets\file_upload\FileUpload',[
        'config'=>[
            //图片上传的一些配置，不写调用默认配置
            // 'domain_url' => 'http://www.yii-china.com',
        ]
    ]) ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? '添加' : '更新', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
